<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>

<div class="pageHeader">
    <form id="pagerForm" action="/manage/pay/list.do" method="post"
          onsubmit="return navTabSearch(this);">
        <div class="searchBar">
            <table class="searchContent">
                <tbody>
                <!--分页输入-->
                <input type="hidden" name="pageNum" value="1"/>
                <input type="hidden" name="numPerPage" value="${pageParam.pageSize eq null ? 20 : pageParam.pageSize}"/>
                <tr>
                    <td>
                        商户号：<input name="merchantId" value="${pageParam.merchantId}"/>
                    </td>
                    <td>
                        <label>创建时间段：</label>
                        <input class="date valid " datefmt="yyyy-MM-dd HH:mm:ss" name="createTimeMin" type="text"
                               maxlength="20"
                               value="${pageParam.createTimeMin}"/>至
                        <input class="date valid " datefmt="yyyy-MM-dd HH:mm:ss" name="createTimeMax" type="text"
                               maxlength="20"
                               value="${pageParam.createTimeMax}"/>
                        </p>
                    </td>

                    <td>
                        <label>支付状态：</label>
                        <select name="payStatus" maxlength="50">
                            <option value="">
                                    未选择
                            </option>
                            <option value="PAY_FAILED"
                                    <c:if test="${pageParam.payStatus == 'PAY_FAILED'}">selected="selected"</c:if>>支付失败
                            </option>
                            <option value="PAY_SUC"
                                    <c:if test="${pageParam.payStatus == 'PAY_SUC' }">selected="selected"</c:if>>支付成功
                            </option>
                            <option value="PAYING"
                                    <c:if test="${pageParam.payStatus == 'PAYING' }">selected="selected"</c:if>>支付中
                            </option>
                        </select>
                    </td>
                </tr>
                </tbody>
            </table>
            <div class="subBar">
                <ul>
                    <li>
                        <div class="buttonActive">
                            <div class="buttonContent">
                                <button type="submit">搜索</button>
                            </div>
                        </div>
                    </li>
                </ul>
            </div>
        </div>
    </form>
</div>

<div class="panelBar">
<%--    <ul class="toolBar">
        <li>
            <a class="add" href="/manage/wallet/pluginCard/beforeAdd" target="dialog" mask="true" rel="banner_add"
               height="450" width="500" title="添加">
                <span>添加</span>
            </a>
        </li>
    </ul>--%>
</div>
<table class="table" width="2000" layoutH="137">
    <thead>
    <tr>
        <th style="width:5%">商户号</th>
        <th style="width:5%">子商户号</th>
        <th style="width:5%">订单号</th>
        <th style="width:5%">交易流水号</th>
        <th style="width:5%">订单日期</th>
        <th style="width:5%">订单金额(单位:分)</th>
        <th style="width:5%">产品金额(单位:分)</th>
        <th style="width:5%">附加金额(单位:分)</th>
        <th style="width:5%">商品信息</th>
        <th style="width:5%">支付状态</th>
        <th style="width:5%">下单时间</th>
        <th style="width:5%">返回码</th>
        <th style="width:5%">返回描述</th>
        <th style="width:5%">网关交易流水号</th>
        <th style="width:5%">支付成功时间</th>
        <th style="width:5%">创建时间</th>
        <th style="width:5%">更新时间</th>
        <th style="width:5%">操作</th>
    </tr>
    </thead>
    <tbody>
    <c:forEach items="${orderList}" var="order" varStatus="status">
        <tr>
            <td>
                <div>${order.merchantId}</div>
            </td>
            <td>
                <div>${order.subMerchantId}</div>
            </td>
            <td>
                <div>${order.orderNo}</div>
            </td>
            <td>
                <div>${order.orderReqNo}</div>
            </td>
            <td><fmt:formatDate value="${order.orderDate}" type="both"
                                pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <td>
                <div>${order.orderAmt}</div>
            </td>
            <td>
                <div>${order.productAmt}</div>
            </td>
            <td>
                <div>${order.attachAmt}</div>
            </td>
            <td>
                <div>${order.goodsName}</div>
            </td>
            <td>
                <c:if test="${order.payStatus == 'PAY_FAILED' }">
                    <div style="color:red;"> 支付失败</div>
                </c:if>
                <c:if test="${order.payStatus == 'PAY_SUC' }">
                    <div style="color:green;"> 支付成功</div>
                </c:if>
                <c:if test="${order.payStatus == 'PAYING' }">
                    <div style="color:yellowgreen;"> 支付中</div>
                </c:if>
            </td>
            <td><fmt:formatDate value="${order.bestPlaceDate}" type="both"
                                pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <td>
                <div>${order.bestPlaceCode}</div>
            </td>
            <td>
                <div>${order.bestPlaceMsg}</div>
            </td>
            <td>
                <div>${order.bestTransNo}</div>
            </td>
            <td><fmt:formatDate value="${order.bestPaySucDate}" type="both"
                                pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <td><fmt:formatDate value="${order.createdDate}" type="both"
                                pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <td><fmt:formatDate value="${order.modifiedDate}" type="both"
                                pattern="yyyy-MM-dd HH:mm:ss"/></td>
            <td>
                <a href="/manage/queryOrderDetail/${order.id}.do" target="dialog" mask="true"
                   rel="wallet_plugin_edit_view"
                   resizable="false" maxable="false" minable="false"
                   title="订单详情" height="450" width="500" class="btnInfo">查看详情</a>
            </td>
        </tr>
    </c:forEach>
    </tbody>
</table>

<!--分页页面组件 -->
<div class="panelBar">
    <div class="pages">
        <span>每页</span>
        <select class="combox" name="numPerPage" onchange="navTabPageBreak({numPerPage:this.value})">
            <option value="20" ${pageParam.pageSize eq 20 ? 'selected':''}>20</option>
            <option value="50" ${pageParam.pageSize eq 50 ? 'selected':''}>50</option>
            <option value="100" ${pageParam.pageSize eq 100 ? 'selected':''}>100</option>
            <option value="200" ${pageParam.pageSize eq 200 ? 'selected':''}>200</option>
        </select>
        <span>条 , 总记录数: ${pageParam.totalCount} 条</span>
    </div>
    <div class="pagination" targetType="navTab" totalCount="${pageParam.totalCount}" numPerPage="${pageParam.pageSize}"
         pageNumShown="10" currentPage="${pageParam.pageNum}"></div>
</div>